import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2023-01-12
 * Time: 10:39
 */
public class test1 {
    public static void main(String[] args) throws InterruptedException {
        BlockingDeque<Integer> blockingDeque=new LinkedBlockingDeque<>(100);

        //带有阻塞功能的入队列
        blockingDeque.offer(1);
        blockingDeque.offer(2);
        blockingDeque.offer(3);

        Integer ret=blockingDeque.take();
        System.out.println(ret);
        ret=blockingDeque.take();
        System.out.println(ret);
        ret=blockingDeque.take();
        System.out.println(ret);

        ret=blockingDeque.take();
        System.out.println(ret);
    }
}
